<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/user/common.jsp"%>
<%@ page import="com.bci.pwtz.common.util.SpringUtil" %>
<%@ page import="com.bci.pwtz.common.util.PwtzUtils" %>
<%@ page import="com.bci.pwtz.mysql.model.Zykgz" %>
<%@ page import="com.bci.pwtz.mysql.model.Zyhwg" %>
<%@ page import="com.bci.pwtz.mysql.model.Zypds" %>
<%@ page import="com.bci.pwtz.mysql.model.Zyxsbdz" %>
<%@ page import="com.bci.pwtz.mysql.model.Zydlfzx" %>
<%@ page import="com.bci.pwtz.mysql.model.Zyxl" %>
<%@ page import="com.bci.pwtz.mysql.model.Zyznblq" %>
<%@ page import="com.bci.pwtz.service.ZykgzService" %>
<%@ page import="com.bci.pwtz.service.ZyhwgService" %>
<%@ page import="com.bci.pwtz.service.ZypdsService" %>
<%@ page import="com.bci.pwtz.service.ZyxsbdzService" %>
<%@ page import="com.bci.pwtz.service.ZydlfzxService" %>
<%@ page import="com.bci.pwtz.service.ZyxlService" %>
<%@ page import="com.bci.pwtz.service.ZyznblqService" %>
<%
Long companyId=null;
if(user!=null){
    companyId=user.getLastCompanyId();
}
String deviceid=request.getParameter("deviceid");
int stationtype=0;
ZykgzService zykgzService=(ZykgzService)SpringUtil.getBean("zykgzService");
ZyhwgService zyhwgService=(ZyhwgService)SpringUtil.getBean("zyhwgService");
ZypdsService zypdsService=(ZypdsService)SpringUtil.getBean("zypdsService");
ZyxsbdzService zyxsbdzService=(ZyxsbdzService)SpringUtil.getBean("zyxsbdzService");
ZydlfzxService zydlfzxService=(ZydlfzxService)SpringUtil.getBean("zydlfzxService");
ZyxlService zyxlService=(ZyxlService)SpringUtil.getBean("zyxlService");
ZyznblqService service=(ZyznblqService)SpringUtil.getBean("zyznblqService");
Zyznblq device=service.load(deviceid);
String stationdevicename="";
String stationdevicetype="";
String linename="";
String linecode="";
String predevicetype="";
String substationcode="";
if(device!=null){
   stationtype=device.getStationdevicetype();
   if(stationtype==124){
       Zykgz stationdevice=zykgzService.load(device.getStationcode());
       stationdevicetype="中压开关站";
       predevicetype="zykgz";
       if(stationdevice!=null){
           stationdevicename=stationdevice.getDevicename();
           Zyxl line=zyxlService.load(device.getLinecode());
           if(line!=null){
               linename=line.getDevicename();
               linecode=line.getDeviceid();
               substationcode=line.getStartsubstationcode();
           }
       }
   }else if(stationtype==125){
       Zypds stationdevice=zypdsService.load(device.getStationcode());
       stationdevicetype="中压配电室";
       predevicetype="zypds";
       if(stationdevice!=null){
           stationdevicename=stationdevice.getDevicename();
           Zyxl line=zyxlService.load(device.getLinecode());
           if(line!=null){
               linename=line.getDevicename();
               linecode=line.getDeviceid();
               substationcode=line.getStartsubstationcode();
           }
       }
   }else if(stationtype==126){
       Zyhwg stationdevice=zyhwgService.load(device.getStationcode());
       stationdevicetype="中压环网柜";
       predevicetype="zyhwg";
       if(stationdevice!=null){
           stationdevicename=stationdevice.getDevicename();
           Zyxl line=zyxlService.load(device.getLinecode());
           if(line!=null){
               linename=line.getDevicename();
               linecode=line.getDeviceid();
               substationcode=line.getStartsubstationcode();
           }
       }
   }else if(stationtype==127){
       Zyxsbdz stationdevice=zyxsbdzService.load(device.getStationcode());
       stationdevicetype="中压箱式变电站";
       predevicetype="zyxsbdz";
       if(stationdevice!=null){
           stationdevicename=stationdevice.getDevicename();
           Zyxl line=zyxlService.load(device.getLinecode());
           if(line!=null){
               linename=line.getDevicename();
               linecode=line.getDeviceid();
               substationcode=line.getStartsubstationcode();
           }
       }
   }else if(stationtype==128){
       Zydlfzx stationdevice=zydlfzxService.load(device.getStationcode());
       stationdevicetype="中压电缆分支箱";
       predevicetype="zydlfzx";
       if(stationdevice!=null){
           stationdevicename=stationdevice.getDevicename();
           Zyxl line=zyxlService.load(device.getLinecode());
           if(line!=null){
               linename=line.getDevicename();
               linecode=line.getDeviceid();
               substationcode=line.getStartsubstationcode();
           }
       }
   }
}

//deviceid="b0feaa5a-d22a-41b5-9d7f-9302e95f5379";

%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>配网数据-中压站内避雷器</title>
<link href="<%=basePath %>user/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>user/css/llcss.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<%=basePath %>js/jquery/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=basePath %>js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=basePath %>user/js/hd_ll.js"></script>
<script type="text/javascript" src="<%=basePath %>user/js/common.js"></script>
<script type="text/javascript" src="<%=basePath %>js/ajaxfileupload.js"></script>
<script type="text/javascript" src="<%=basePath %>js/toolutils.js"></script>
<script type="text/javascript">
var companyId=<%=companyId%>;
var deviceid='<%=device.getStationcode()%>';
var devicetype=<%=stationtype%>;
var counterfactory = '<%=device.getCounterfactory() %>';
var countertype='<%=device.getCountertype()%>';
var model = '<%=device.getModel()%>';
var productionfactory = '<%=device.getProductionfactory()%>';
</script>
<script type="text/javascript" src="<%=basePath %>user/z/js/zyznblqadd.js"></script>
<script type="text/javascript">
function selectLoad(){
	setDefault('operationstate','<%=device.getOperationstate()%>');
	setDefault('isruralpowernetwork','<%=device.getIsruralpowernetwork()%>');
	setDefault('isgenerationdimension','<%=device.getIsgenerationdimension()%>');
	setDefault('importantdegree','<%=device.getImportantdegree()%>');
	setDefault('equipmentstate','<%=device.getEquipmentstate()%>');
	setDefault('model','<%=device.getModel()%>');
	setDefault('productionfactory','<%=device.getProductionfactory()%>');
	setDefault('assetsnature','<%=device.getAssetsnature()%>');
	setDefault('voltagelevel','<%=device.getVoltagelevel()%>');
	setDefault('regionalcharacteristics','<%=device.getRegionalcharacteristics()%>');
	setDefault('equipmentadded','<%=device.getEquipmentadded()%>');
	setDefault('combinationdevicetype','<%=device.getCombinationdevicetype()%>');
	zhsbChange();
}
</script>
</head>
<body bgcolor="white" onload="selectLoad()">
	<%@ include file="/user/head.jsp"%>
	<!-- main_begin -->
	<div class="pwsj_cont_box">
	<%@ include file="/user/left.jsp"%>
	<!-- 右侧内容_begin -->
	<%if(device!=null) {%>
	<form id="form">
		<div class="pwsj_cont_right_box" scroll="no">
		<!-- 柱上变压器_begin -->
		<div class="pwsj_right_byq" scroll="no">
			<div class="pwsj_right_byq_position" style="margin-bottom:3px;">
				<a href="<%=basePath %>user/m/index.jsp" class="position">配网数据</a>&gt;
				<a href="<%=basePath %>user/z/bdzlist.jsp" class="position">变电站</a>&gt;
				<a href="<%=basePath %>user/z/zyxllist.jsp?deviceid=<%=substationcode %>" class="position">中压线路</a>&gt;
				<a href="<%=basePath %>user/z/<%=predevicetype %>list.jsp?deviceid=<%=linecode %>" class="position"><%=stationdevicetype %></a>&gt;
				<a  class="position">修改中压站内避雷器</a>
				<a class="right" href="<%=basePath%>user/z/zyznblqlist.jsp?deviceid=<%=device.getStationcode()%>&devicetype=<%=device.getStationdevicetype()%>">返回</a><a class="right"  onclick="edite()">保存</a>
			</div>
			<!-- 运行参数_begin -->
			<div class="argument_box">
				<!-- 参数标题-begin -->
				<div class="argument_title">
					<p class="title">运行参数</p>
					<a  class="show"></a>
					<div class="clear"></div>
				</div>				
				<!-- 参数标题-end -->
				<!-- 参数内容_begin -->
				<div class="argument_cont_box">
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>设备名称：</span><input class="text" type="hidden" value="<%=deviceid%>" name="deviceid"/><input class="text" type="text" id="devicename" name="devicename" maxlength="100" value="<%=device.getDevicename()%>"/><em style="color:red;"> *</em></li>
						<li class="argument_cont_li"><span>运行编号：</span><input class="text" type="text" id="devicenumber" name="devicenumber" value="<%=device.getDevicenumber()%>"/></li>
						<li class="argument_cont_li">
							<span>所属线路名称：</span><input class="text" type="text" readonly="readonly" value="<%=linename%>"/><input type="hidden" class="text" name="linecode" value="<%=linecode%>"/>
							</li>						
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>所属站房类型：</span><input class="text" type="hidden" value="<%=device.getStationdevicetype()%>" name="stationdevicetype" /><input class="text" type="text" readonly="readonly" value="<%=stationdevicetype%>"/> </li>	
						<li class="argument_cont_li"><span>所属站房名称：</span><input class="text" type="text" readonly="readonly" value="<%=stationdevicename%>"/><input class="text" type="hidden" name="stationcode" value="<%=device.getStationcode()%>"/></li>
						<li class="argument_cont_li"><span>所属地市：</span><input class="text" type="text" name="localcity" value="<%=device.getLocalcity()%>"/><!-- <em style="color:red;"> *</em> --></li>					
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>运维单位：</span><input class="text" type="text" name="operationunit" value="<%=device.getOperationunit()%>"/><!-- <em style="color:red;"> *</em> --></li>
						<li class="argument_cont_li"><span>维护班组：</span><input class="text" type="text" name="maintenanceteam" value="<%=device.getMaintenanceteam()%>"/><!-- <em style="color:red;"> *</em> --></li>
						<li class="argument_cont_li">
							<span>电压等级：</span>
							<select name="voltagelevel" id="voltagelevel" class="select_down">
								<option value="110kv">110kv</option>
								<option value="35kv">35kv</option>
								<option value="20kv">20kv</option>
								<option value="10kv">10kv</option>
								<option value="6kv">6kv</option>
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>							
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>间隔单元：</span><input class="text" type="text" name="gapcode" value="<%=device.getGapcode()%>"/><!-- <em style="color:red;"> *</em> --></li>
						<li class="argument_cont_li">
							<span>组合设备类型：</span>
							<select class="select_down" id="combinationdevicetype" name="combinationdevicetype">  
								<option value ="否">否</option>  
								<option value ="开关站">开关站</option>
								<option value ="环网柜">环网柜</option> 
								<option value ="箱式变电站">箱式变电站</option>
								<option value ="电缆分支箱">电缆分支箱</option>			
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<li class="argument_cont_li"><span>组合设备名称：</span><input class="text" type="text" name="combinationdevicename" value="<%=device.getCombinationdevicename()%>"/></li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li" style="position:relative;"><span>投运日期：</span><input class="text" type="text"  placeholder="请选择日期" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="commissioningdate" value="<%=PwtzUtils.date2String(device.getCommissioningdate(), "yyyy-MM-dd")%>"/><img width="16" height="16" src="../images/select_date.jpg" style="position:absolute; top:12px;left:230px;" /><!-- <em style="color:red;"> *</em> --></li>
						<li class="argument_cont_li">
							<span>运行状态：</span>
							<select class="select_down" id="operationstate" name="operationstate">  
								<option value ="正常">正常</option>  
								<option value ="异常">异常</option>
								<option value ="故障">故障</option>
								<option value ="缺陷">缺陷</option> 			
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>	
						<li class="argument_cont_li">
							<span>是否农网：</span>
							<select class="select_down" id="isruralpowernetwork" name="isruralpowernetwork">  
								<option value ="否">否</option>  
								<option value ="是">是</option> 			
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li">
							<span>是否代维：</span>
							<select class="select_down" id="isgenerationdimension" name="isgenerationdimension">  
								<option value ="否">否</option>  
								<option value ="是">是</option>		
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<li class="argument_cont_li">
							<span>重要程度：</span>
							<select class="select_down" id="importantdegree" name="importantdegree">  
								<option value ="一般">一般</option>  
								<option value ="重要">重要</option>
								<option value ="特别重要">特别重要</option> 			
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>							
						<li class="argument_cont_li">
							<span>设备状态：</span>
							<select class="select_down" id="equipmentstate" name="equipmentstate">  
								<option value ="在运">在运</option>  
								<option value ="未投运">未投运</option>
								<option value ="退役">退役</option>
								<option value ="现场留用">现场留用</option>
								<option value ="库存备用">库存备用</option>
								<option value ="待报废">待报废</option>
								<option value ="报废">报废</option>
								<option value ="正常">正常</option>
								<option value ="异常">异常</option> 			
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li">
							<span>设备主人：</span><input class="text" type="text" name="equipmentowner" value="<%=device.getEquipmentowner()%>"/>
						</li>
						<li class="argument_cont_li">
							<span>地区特征：</span>
							<select class="select_down" id="regionalcharacteristics" name="regionalcharacteristics">  
								<option value ="市中心区">市中心区</option>  
								<option value ="市区">市区</option>
								<option value ="郊区">郊区</option>
								<option value ="县城">县城</option>
								<option value ="县城">农村</option>
								<option value ="牧区">牧区</option>
								<option value ="林区">林区</option>			
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<div class="clear"></div>
					</ul>
				</div>
				<!-- 参数内容_end -->
			</div>
			<!-- 运行参数_end -->

			<!-- 物理参数_begin -->
			<div class="argument_box">
				<!-- 参数标题-begin -->
				<div class="argument_title">
					<p class="title">物理参数</p>
					<a  class="show"></a>
					<div class="clear"></div>
				</div>				
				<!-- 参数标题-end -->
				<!-- 参数内容_begin -->
				<div class="argument_cont_box">
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>型号：</span>
							<select class="select_down" id="model" name="model">			
							</select>
							<a title="手动输入" onclick="dictionaryadd('型号',141001,this)"><img src="../images/transformer_img_add.png" alt="" /></a>
						</li>
						<li class="argument_cont_li"><span>生产厂家：</span>
							<select class="select_down" id="productionfactory" name="productionfactory">			
							</select>
							<a title="手动输入" onclick="dictionaryadd('生产厂家',141002,this)"><img src="../images/transformer_img_add.png" alt="" /></a>
						</li>
						<li class="argument_cont_li" style="position:relative;"><span>出厂日期：</span><input class="text" type="text"  placeholder="请选择日期" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="factorydate" value="<%=PwtzUtils.date2String(device.getFactorydate(), "yyyy-MM-dd")%>"/><img width="16" height="16" src="../images/select_date.jpg" style="position:absolute; top:12px;left:230px;" /></li>							
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>出厂编号：</span><input class="text" type="text" name="serialnumber" value="<%=device.getSerialnumber()%>"/></li>
						<li class="argument_cont_li">
							<span>额定电压：</span><input class="text" type="text" name="ratedvoltage" value="<%=device.getRatedvoltage()%>"/>
						</li>							
						<li class="argument_cont_li"><span>工频放电电压：</span><input type="text" class="text" name="workingvoltage" value="<%=device.getWorkingvoltage()%>"/></li>
						<div class="clear"></div>
					</ul>	
					<ul class="argument_cont_ul">
						<li class="argument_cont_li">
							<span>计数器型号：</span>
							<select class="select_down" name="countertype" id="countertype"></select>
							<a title="手动输入" onclick="dictionaryadd('计数器型号',141003,this)"><img src="../images/transformer_img_add.png" alt="" /></a>
						</li>
						<li class="argument_cont_li">
							<span>计数器生产厂家：</span>
							<select class="select_down" name="counterfactory" id="counterfactory"></select>
							<a title="手动输入" onclick="dictionaryadd('计数器生产厂家',141004,this)"><img src="../images/transformer_img_add.png" alt="" /></a>
						</li>
						<li class="argument_cont_li"><span>计数器动作次数：</span><input class="text" type="number" min="0" value="<%=device.getCountertimes()%>" name="countertimes"/><!-- <em style="color:red;"> *</em> --></li>	
						<div class="clear"></div>
					</ul>	
				</div>
				<!-- 参数内容_end -->
			</div>
			<!-- 物理参数_end -->

			<!-- 资产参数_begin -->
			<div class="argument_box">
				<!-- 参数标题-begin -->
				<div class="argument_title">
					<p class="title">资产参数</p>
					<a  class="show"></a>
					<div class="clear"></div>
				</div>				
				<!-- 参数标题-end -->
				<!-- 参数内容_begin -->
				<div class="argument_cont_box">
					<ul class="argument_cont_ul">
						<li class="argument_cont_li">
							<span>资产性质：</span>
							<select class="select_down" id="assetsnature" name="assetsnature">  
								<option value ="用户">用户</option>  
								<option value ="公司">公司</option>
								<option value ="子公司">子公司</option>
								<option value ="省(直辖市、自治区)">省(直辖市、自治区)</option>				
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<li class="argument_cont_li"><span>资产单位：</span><input class="text" type="text" name="assetunit" value="<%=device.getAssetunit()%>"/></li>
						<li class="argument_cont_li"><span>资产编号：</span><input class="text" type="text" name="assetnumber" value="<%=device.getAssetnumber()%>"/><!-- <em style="color:red;"> *</em> --></li>	
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>工程编号：</span><input class="text" type="text" name="projectnumber" value="<%=device.getProjectnumber()%>"/></li>
						<li class="argument_cont_li"><span>工程名称：</span><input class="text" type="text" name="projectname" value="<%=device.getProjectname()%>"/></li>	
						<li class="argument_cont_li">
							<span>设备添加方式：</span>
							<select class="select_down" id="equipmentadded" name="equipmentadded">  
								<option value ="基本建设">基本建设</option>  
								<option value ="技术改造">技术改造</option>
								<option value ="投资者投入">投资者投入</option>
								<option value ="融资租入">融资租入</option>
								<option value ="债务重组取得">债务重组取得</option>
								<option value ="接受捐赠">接受捐赠</option>
								<option value ="无偿调入">无偿调入</option>
								<option value ="盘盈">盘盈</option>
								<option value ="其它">其它</option>				
							</select>
						</li>
						<div class="clear"></div>
					</ul>					
				</div>
				<!-- 参数内容_end -->
			</div>
			<!-- 资产参数_end -->
		</div>	
		<!-- 柱上变压器_end -->		
	</div>
	</form>
	<%}else{ %>
	<h4>设备id错误</h4>
	<%} %>
	<!-- 右侧内容_end -->
	<div class="clear"></div><!-- 清除左右浮动 -->
	</div>
	<!-- main_end -->
	<%@ include file="/user/foot.jsp"%>
</body>
</html>